/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.hl7.v3.impl;

import java.util.Collection;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;

import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.Enumerator;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;

import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.emf.ecore.impl.EObjectImpl;

import org.eclipse.emf.ecore.util.EObjectContainmentEList;
import org.eclipse.emf.ecore.util.InternalEList;

import org.hl7.v3.AD;
import org.hl7.v3.CS1;
import org.hl7.v3.II;
import org.hl7.v3.ON;
import org.hl7.v3.POCDMT000040CustodianOrganization;
import org.hl7.v3.POCDMT000040InfrastructureRootTypeId;
import org.hl7.v3.TEL;
import org.hl7.v3.V3Factory;
import org.hl7.v3.V3Package;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>POCDMT000040 Custodian Organization</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040CustodianOrganizationImpl#getRealmCode <em>Realm Code</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040CustodianOrganizationImpl#getTypeId <em>Type Id</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040CustodianOrganizationImpl#getTemplateId <em>Template Id</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040CustodianOrganizationImpl#getId <em>Id</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040CustodianOrganizationImpl#getName <em>Name</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040CustodianOrganizationImpl#getTelecom <em>Telecom</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040CustodianOrganizationImpl#getAddr <em>Addr</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040CustodianOrganizationImpl#getClassCode <em>Class Code</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040CustodianOrganizationImpl#getDeterminerCode <em>Determiner Code</em>}</li>
 *   <li>{@link org.hl7.v3.impl.POCDMT000040CustodianOrganizationImpl#getNullFlavor <em>Null Flavor</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class POCDMT000040CustodianOrganizationImpl extends EObjectImpl implements POCDMT000040CustodianOrganization {
	/**
	 * The cached value of the '{@link #getRealmCode() <em>Realm Code</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getRealmCode()
	 * @generated
	 * @ordered
	 */
	protected EList<CS1> realmCode;

	/**
	 * The cached value of the '{@link #getTypeId() <em>Type Id</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTypeId()
	 * @generated
	 * @ordered
	 */
	protected POCDMT000040InfrastructureRootTypeId typeId;

	/**
	 * The cached value of the '{@link #getTemplateId() <em>Template Id</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTemplateId()
	 * @generated
	 * @ordered
	 */
	protected EList<II> templateId;

	/**
	 * The cached value of the '{@link #getId() <em>Id</em>}' containment reference list.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getId()
	 * @generated
	 * @ordered
	 */
	protected EList<II> id;

	/**
	 * The cached value of the '{@link #getName() <em>Name</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getName()
	 * @generated
	 * @ordered
	 */
	protected ON name;

	/**
	 * The cached value of the '{@link #getTelecom() <em>Telecom</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getTelecom()
	 * @generated
	 * @ordered
	 */
	protected TEL telecom;

	/**
	 * The cached value of the '{@link #getAddr() <em>Addr</em>}' containment reference.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getAddr()
	 * @generated
	 * @ordered
	 */
	protected AD addr;

	/**
	 * The default value of the '{@link #getClassCode() <em>Class Code</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getClassCode()
	 * @generated
	 * @ordered
	 */
	protected static final Enumerator CLASS_CODE_EDEFAULT = (Enumerator)V3Factory.eINSTANCE.createFromString(V3Package.eINSTANCE.getEntityClassOrganization(), "ORG");

	/**
	 * The cached value of the '{@link #getClassCode() <em>Class Code</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getClassCode()
	 * @generated
	 * @ordered
	 */
	protected Enumerator classCode = CLASS_CODE_EDEFAULT;

	/**
	 * This is true if the Class Code attribute has been set.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	protected boolean classCodeESet;

	/**
	 * The default value of the '{@link #getDeterminerCode() <em>Determiner Code</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDeterminerCode()
	 * @generated
	 * @ordered
	 */
	protected static final Enumerator DETERMINER_CODE_EDEFAULT = (Enumerator)V3Factory.eINSTANCE.createFromString(V3Package.eINSTANCE.getEntityDeterminer(), "INSTANCE");

	/**
	 * The cached value of the '{@link #getDeterminerCode() <em>Determiner Code</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getDeterminerCode()
	 * @generated
	 * @ordered
	 */
	protected Enumerator determinerCode = DETERMINER_CODE_EDEFAULT;

	/**
	 * This is true if the Determiner Code attribute has been set.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 * @ordered
	 */
	protected boolean determinerCodeESet;

	/**
	 * The default value of the '{@link #getNullFlavor() <em>Null Flavor</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNullFlavor()
	 * @generated
	 * @ordered
	 */
	protected static final Enumerator NULL_FLAVOR_EDEFAULT = null;

	/**
	 * The cached value of the '{@link #getNullFlavor() <em>Null Flavor</em>}' attribute.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #getNullFlavor()
	 * @generated
	 * @ordered
	 */
	protected Enumerator nullFlavor = NULL_FLAVOR_EDEFAULT;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	protected POCDMT000040CustodianOrganizationImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	protected EClass eStaticClass() {
		return V3Package.eINSTANCE.getPOCDMT000040CustodianOrganization();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<CS1> getRealmCode() {
		if (realmCode == null) {
			realmCode = new EObjectContainmentEList<CS1>(CS1.class, this, V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__REALM_CODE);
		}
		return realmCode;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public POCDMT000040InfrastructureRootTypeId getTypeId() {
		return typeId;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetTypeId(POCDMT000040InfrastructureRootTypeId newTypeId, NotificationChain msgs) {
		POCDMT000040InfrastructureRootTypeId oldTypeId = typeId;
		typeId = newTypeId;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TYPE_ID, oldTypeId, newTypeId);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTypeId(POCDMT000040InfrastructureRootTypeId newTypeId) {
		if (newTypeId != typeId) {
			NotificationChain msgs = null;
			if (typeId != null)
				msgs = ((InternalEObject)typeId).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TYPE_ID, null, msgs);
			if (newTypeId != null)
				msgs = ((InternalEObject)newTypeId).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TYPE_ID, null, msgs);
			msgs = basicSetTypeId(newTypeId, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TYPE_ID, newTypeId, newTypeId));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<II> getTemplateId() {
		if (templateId == null) {
			templateId = new EObjectContainmentEList<II>(II.class, this, V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TEMPLATE_ID);
		}
		return templateId;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EList<II> getId() {
		if (id == null) {
			id = new EObjectContainmentEList<II>(II.class, this, V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__ID);
		}
		return id;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public ON getName() {
		return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetName(ON newName, NotificationChain msgs) {
		ON oldName = name;
		name = newName;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__NAME, oldName, newName);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setName(ON newName) {
		if (newName != name) {
			NotificationChain msgs = null;
			if (name != null)
				msgs = ((InternalEObject)name).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__NAME, null, msgs);
			if (newName != null)
				msgs = ((InternalEObject)newName).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__NAME, null, msgs);
			msgs = basicSetName(newName, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__NAME, newName, newName));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public TEL getTelecom() {
		return telecom;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetTelecom(TEL newTelecom, NotificationChain msgs) {
		TEL oldTelecom = telecom;
		telecom = newTelecom;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TELECOM, oldTelecom, newTelecom);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setTelecom(TEL newTelecom) {
		if (newTelecom != telecom) {
			NotificationChain msgs = null;
			if (telecom != null)
				msgs = ((InternalEObject)telecom).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TELECOM, null, msgs);
			if (newTelecom != null)
				msgs = ((InternalEObject)newTelecom).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TELECOM, null, msgs);
			msgs = basicSetTelecom(newTelecom, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TELECOM, newTelecom, newTelecom));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public AD getAddr() {
		return addr;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public NotificationChain basicSetAddr(AD newAddr, NotificationChain msgs) {
		AD oldAddr = addr;
		addr = newAddr;
		if (eNotificationRequired()) {
			ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__ADDR, oldAddr, newAddr);
			if (msgs == null) msgs = notification; else msgs.add(notification);
		}
		return msgs;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setAddr(AD newAddr) {
		if (newAddr != addr) {
			NotificationChain msgs = null;
			if (addr != null)
				msgs = ((InternalEObject)addr).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__ADDR, null, msgs);
			if (newAddr != null)
				msgs = ((InternalEObject)newAddr).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__ADDR, null, msgs);
			msgs = basicSetAddr(newAddr, msgs);
			if (msgs != null) msgs.dispatch();
		}
		else if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__ADDR, newAddr, newAddr));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Enumerator getClassCode() {
		return classCode;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setClassCode(Enumerator newClassCode) {
		Enumerator oldClassCode = classCode;
		classCode = newClassCode;
		boolean oldClassCodeESet = classCodeESet;
		classCodeESet = true;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__CLASS_CODE, oldClassCode, classCode, !oldClassCodeESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void unsetClassCode() {
		Enumerator oldClassCode = classCode;
		boolean oldClassCodeESet = classCodeESet;
		classCode = CLASS_CODE_EDEFAULT;
		classCodeESet = false;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.UNSET, V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__CLASS_CODE, oldClassCode, CLASS_CODE_EDEFAULT, oldClassCodeESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isSetClassCode() {
		return classCodeESet;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Enumerator getDeterminerCode() {
		return determinerCode;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setDeterminerCode(Enumerator newDeterminerCode) {
		Enumerator oldDeterminerCode = determinerCode;
		determinerCode = newDeterminerCode;
		boolean oldDeterminerCodeESet = determinerCodeESet;
		determinerCodeESet = true;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__DETERMINER_CODE, oldDeterminerCode, determinerCode, !oldDeterminerCodeESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void unsetDeterminerCode() {
		Enumerator oldDeterminerCode = determinerCode;
		boolean oldDeterminerCodeESet = determinerCodeESet;
		determinerCode = DETERMINER_CODE_EDEFAULT;
		determinerCodeESet = false;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.UNSET, V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__DETERMINER_CODE, oldDeterminerCode, DETERMINER_CODE_EDEFAULT, oldDeterminerCodeESet));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public boolean isSetDeterminerCode() {
		return determinerCodeESet;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public Enumerator getNullFlavor() {
		return nullFlavor;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public void setNullFlavor(Enumerator newNullFlavor) {
		Enumerator oldNullFlavor = nullFlavor;
		nullFlavor = newNullFlavor;
		if (eNotificationRequired())
			eNotify(new ENotificationImpl(this, Notification.SET, V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__NULL_FLAVOR, oldNullFlavor, nullFlavor));
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
		switch (featureID) {
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__REALM_CODE:
				return ((InternalEList<?>)getRealmCode()).basicRemove(otherEnd, msgs);
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TYPE_ID:
				return basicSetTypeId(null, msgs);
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TEMPLATE_ID:
				return ((InternalEList<?>)getTemplateId()).basicRemove(otherEnd, msgs);
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__ID:
				return ((InternalEList<?>)getId()).basicRemove(otherEnd, msgs);
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__NAME:
				return basicSetName(null, msgs);
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TELECOM:
				return basicSetTelecom(null, msgs);
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__ADDR:
				return basicSetAddr(null, msgs);
		}
		return super.eInverseRemove(otherEnd, featureID, msgs);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public Object eGet(int featureID, boolean resolve, boolean coreType) {
		switch (featureID) {
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__REALM_CODE:
				return getRealmCode();
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TYPE_ID:
				return getTypeId();
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TEMPLATE_ID:
				return getTemplateId();
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__ID:
				return getId();
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__NAME:
				return getName();
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TELECOM:
				return getTelecom();
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__ADDR:
				return getAddr();
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__CLASS_CODE:
				return getClassCode();
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__DETERMINER_CODE:
				return getDeterminerCode();
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__NULL_FLAVOR:
				return getNullFlavor();
		}
		return super.eGet(featureID, resolve, coreType);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@SuppressWarnings("unchecked")
	@Override
	public void eSet(int featureID, Object newValue) {
		switch (featureID) {
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__REALM_CODE:
				getRealmCode().clear();
				getRealmCode().addAll((Collection<? extends CS1>)newValue);
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TYPE_ID:
				setTypeId((POCDMT000040InfrastructureRootTypeId)newValue);
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TEMPLATE_ID:
				getTemplateId().clear();
				getTemplateId().addAll((Collection<? extends II>)newValue);
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__ID:
				getId().clear();
				getId().addAll((Collection<? extends II>)newValue);
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__NAME:
				setName((ON)newValue);
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TELECOM:
				setTelecom((TEL)newValue);
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__ADDR:
				setAddr((AD)newValue);
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__CLASS_CODE:
				setClassCode((Enumerator)newValue);
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__DETERMINER_CODE:
				setDeterminerCode((Enumerator)newValue);
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__NULL_FLAVOR:
				setNullFlavor((Enumerator)newValue);
				return;
		}
		super.eSet(featureID, newValue);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public void eUnset(int featureID) {
		switch (featureID) {
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__REALM_CODE:
				getRealmCode().clear();
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TYPE_ID:
				setTypeId((POCDMT000040InfrastructureRootTypeId)null);
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TEMPLATE_ID:
				getTemplateId().clear();
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__ID:
				getId().clear();
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__NAME:
				setName((ON)null);
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TELECOM:
				setTelecom((TEL)null);
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__ADDR:
				setAddr((AD)null);
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__CLASS_CODE:
				unsetClassCode();
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__DETERMINER_CODE:
				unsetDeterminerCode();
				return;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__NULL_FLAVOR:
				setNullFlavor(NULL_FLAVOR_EDEFAULT);
				return;
		}
		super.eUnset(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public boolean eIsSet(int featureID) {
		switch (featureID) {
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__REALM_CODE:
				return realmCode != null && !realmCode.isEmpty();
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TYPE_ID:
				return typeId != null;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TEMPLATE_ID:
				return templateId != null && !templateId.isEmpty();
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__ID:
				return id != null && !id.isEmpty();
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__NAME:
				return name != null;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__TELECOM:
				return telecom != null;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__ADDR:
				return addr != null;
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__CLASS_CODE:
				return isSetClassCode();
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__DETERMINER_CODE:
				return isSetDeterminerCode();
			case V3Package.POCDMT000040_CUSTODIAN_ORGANIZATION__NULL_FLAVOR:
				return NULL_FLAVOR_EDEFAULT == null ? nullFlavor != null : !NULL_FLAVOR_EDEFAULT.equals(nullFlavor);
		}
		return super.eIsSet(featureID);
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		if (eIsProxy()) return super.toString();

		StringBuffer result = new StringBuffer(super.toString());
		result.append(" (classCode: ");
		if (classCodeESet) result.append(classCode); else result.append("<unset>");
		result.append(", determinerCode: ");
		if (determinerCodeESet) result.append(determinerCode); else result.append("<unset>");
		result.append(", nullFlavor: ");
		result.append(nullFlavor);
		result.append(')');
		return result.toString();
	}

} //POCDMT000040CustodianOrganizationImpl
